import { docMgr } from '@app-cad/module';

/**
 * 创建一个用于3d-render sdk 渲染模型的信息
 */
const createModelInfo = (dxid: string, visibility: boolean) => {
  const docObjects = docMgr.flatDocumentObjects;

  const info = docObjects.find((obj) => {
    return obj.dxid === dxid;
  });
  const label = info?.label ?? '';
  const mark = info?.mark ?? [];
  const materials = info?.materials ?? { faces: [] };
  return {
    shape: dxid,
    dxid,
    label,
    materials,
    mark,
    children: [],
    sortid: 9,
    type: 'GeomBox',
    visibility: visibility,
  };
};
export { createModelInfo };
